#ifdef ANDROID

#include <sys/syscall.h>
#include <sys/types.h>
#include <sys/time.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <unistd.h>
#include <signal.h>
#include <poll.h>
#include <fcntl.h>
#include <time.h>
#include <errno.h>


/*
 * This were good at the time of 2.6.23-rc7 ...
 */
/*
#ifndef __NR_timerfd
#if defined(__x86_64__)
#define __NR_timerfd_create 283
#define __NR_timerfd_settime 286
#define __NR_timerfd_gettime 287
#elif defined(__i386__)
#define __NR_timerfd_create 322
#define __NR_timerfd_settime 325
#define __NR_timerfd_gettime 326
#else
#error Cannot detect your architecture!
#endif
#endif
#endif
*/



/* Definitions from include/linux/timerfd.h */
//#define TFD_TIMER_ABSTIME (1 << 0)



int timerfd_create(int clockid, int flags) {

	return syscall(__NR_timerfd_create, clockid, flags);
}

int timerfd_settime(int ufc, int flags, const struct itimerspec *utmr,
		    struct itimerspec *otmr) {

	return syscall(__NR_timerfd_settime, ufc, flags, utmr, otmr);
}

int timerfd_gettime(int ufc, struct itimerspec *otmr) {

	return syscall(__NR_timerfd_gettime, ufc, otmr);
}

#endif
